Assignment 28: Plotly - Utkarsh Gaikwad

Assignment pdf link

Question 1

Question 1: Load the "titanic" dataset using the load_dataset function of seaborn. Use Plotly express to plot a scatter plot for age and fare columns in the titanic dataset.


Answer :

Loading titanic dataset

Plotting the scatter plot

Question 2

Question 2: Using the tips dataset in the Plotly library, plot a box plot using Plotly express


Answer :

Importing tips dataset from plotly express

Plotting Boxplot

Question 3

Question 3: Using the tips dataset in the Plotly library, Plot a histogram for x= "sex" and y="total_bill" column in the tips dataset. Also, use the "smoker" column with the pattern_shape parameter and the "day"column with the color parameter.


Answer:

Question 4

Question 4: Using the iris dataset in the Plotly library, Plot a scatter matrix plot, using the "species" column for the color parameter.

Note : Use "sepal_length", "sepal_width", "petal_length", "petal_width" columns only with the dimensions parameter.


Answer :

Question 5

Question 5: What is Distplot? Using Plotly express, plot a distplot


Answer :

A Distplot or distribution plot, depicts the variation in the data distribution. Seaborn Distplot represents the overall distribution of continuous data variables.

The Seaborn module along with the Matplotlib module is used to depict the distplot with different variations in it. The Distplot depicts the data by a histogram and a line in combination to it.

Plotly express has px.histogram as the function

Can also plot distplot like below